package 机试题16年;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/4/18.
 */
public class 犯罪转移1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int t = sc.nextInt();
            int c = sc.nextInt();
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = sc.nextInt();
            }
            System.out.println(carryMan(n, t, c, a));
        }
        sc.close();
    }

    private static int carryMan(int n, int t, int c, int[] a) {
        int count = 0;
        int sum = 0;
        for (int i = 0; i < c; i++) {
            sum += a[i];
        }
        if (sum <= t) {
            count++;
        }
        for (int i = c; i < n; i++) {
            //滑动窗口
            sum += a[i] - a[i - c];
            if (sum <= t) {
                count++;
            }
        }
        return count;
    }


}
